package com.hyt.it.ogt.kq.common.gov.enums;

import lombok.Getter;

/**
 * 作答方式，1：电子作答，2：纸笔作答
 */
@Getter
public enum AnswerTypeEnum {
    COMPUTER(1, "电子作答"),
    PAPER(2, "纸笔作答"),
    ;

    private final Integer type;
    private final String desc;

    AnswerTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static String getDescByType(Integer type) {
        if (type == null) {
            return null;
        }
        for (AnswerTypeEnum e : values()) {
            if (e.getType() == type) {
                return e.getDesc();
            }
        }
        return null;
    }
}
